import { Controller, Get, Post, Put, Delete, Body, Param } from '@nestjs/common';
import { ApiOperation, ApiTags } from '@nestjs/swagger';
import { {{modelName}}Service } from './{{feature}}.service';
import { {{modelName}}Dto } from './{{feature}}.dto';

@ApiTags('{{feature}}')
@Controller('{{feature}}')
export class {{modelName}}Controller {
  constructor(private readonly service: {{modelName}}Service) {}

  @Post()
  @ApiOperation({ summary: 'Create {{feature}}' })
  create(@Body() dto: {{modelName}}Dto) {
    return this.service.create(dto);
  }

  @Get()
  @ApiOperation({ summary: 'List {{feature}}' })
  findAll() {
    return this.service.findAll();
  }

  @Get(':id')
  @ApiOperation({ summary: 'Get {{feature}} by id' })
  findOne(@Param('id') id: string) {
    return this.service.findOne(+id);
  }

  @Put(':id')
  @ApiOperation({ summary: 'Update {{feature}} by id' })
  update(@Param('id') id: string, @Body() dto: {{modelName}}Dto) {
    return this.service.update(+id, dto);
  }

  @Delete(':id')
  @ApiOperation({ summary: 'Delete {{feature}} by id' })
  remove(@Param('id') id: string) {
    return this.service.remove(+id);
  }
}
